package org.snare.alumni.modules.admin.card.service.api;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.snare.alumni.modules.admin.card.dto.CardDTO;
import org.snare.alumni.modules.admin.card.dto.CardSameVO;
import org.snare.alumni.modules.admin.card.entity.CardEntity;
import org.snare.spider.common.base.Limit;
import org.snare.spider.service.annotation.ApiGet;
import org.snare.spider.service.annotation.ApiPost;
import org.snare.spider.service.annotation.ApiService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;


@ApiService(mapping = "/alumni/card", desc = "系统管理-校园卡")
public interface CardService {

    @ApiGet(mapping = {"/page"}, desc = "分页")
    IPage<CardDTO> page(CardDTO params, Limit limit);

    @ApiPost(mapping = {"/add"}, desc = "新增")
    void add(@RequestBody @Valid CardDTO params);

    @ApiPost(mapping = {"/edit"}, desc = "编辑")
    void edit(@RequestBody @Valid CardDTO params);

    @ApiGet(mapping = {"/delete"}, desc = "删除")
    void delete(@RequestParam String id);

    @ApiPost(mapping = {"/detail"}, desc = "详情")
    CardDTO detail(String id, String uid);

    @ApiPost(mapping = {"/approve"}, desc = "审批")
    void approve(@RequestBody CardDTO params);

    @ApiPost(mapping = {"/sameClass"}, desc = "同班同学")
    List<CardSameVO> sameClass(String position, String uid);

    @ApiPost(mapping = {"/checkApply"}, desc = "是否申请")
    boolean checkApply(String uid);

    @ApiGet(mapping = {"/getCount"}, desc = "数量查询")
    List<Map<String, Object>> getCount();

    @ApiGet(mapping = {"/getLocationCard"}, desc = "获取定位校友")
    List<CardDTO> getLocationCard();

}
